// 请求 URL 地址，统一管理
import { MEMBER_DOMAIN, SHOP_DMAIN, OPEN_DMAIN, MARKET_DOMAIN, INVENTORY_DOMAIN } from '@constants/domain';

export const OPEN_URL = {
    wechatOpenId: `${OPEN_DMAIN}/v1/mini/wechat/login`,
    alipayUserId: `${OPEN_DMAIN}/v1/mini/alipay/login`,
    tiktokOpenId: `${OPEN_DMAIN}/v1/mini/bytedance/login`,
};

export const MEMBER_URL = {
    match: `${MEMBER_DOMAIN}/member/api/v1/geo/address`,
    search: `${MEMBER_DOMAIN}/member/api/v1/address/search`,
    openId: `${MEMBER_DOMAIN}/openid`,
    check: `${MEMBER_DOMAIN}/api/member/v1/check`,
    login: `${MEMBER_DOMAIN}/member/api/v1/platform/login`,
    register: `${MEMBER_DOMAIN}/member/api/v1/platform/register`,
    update: `${MEMBER_DOMAIN}/member/api/v1/info/update`,
    groupCheck: `${MEMBER_DOMAIN}/member/api/card/v1/group/check`,
    sendCode: `${MEMBER_DOMAIN}/member/api/v1/mobile/verify-code/send`,
    bindMobile: `${MEMBER_DOMAIN}/member/api/v1/mobile/bind`,
    bindMobileByWechat: `${MEMBER_DOMAIN}/member/api/v1/wechat/encrypted-mobile/bind`,
    join: `${MEMBER_DOMAIN}/member/api/v1/join`,
    account: `${MEMBER_DOMAIN}/member/api/v1/account/info`,
    balanceLog: `${MEMBER_DOMAIN}/member/api/asset/v1/balance/records`,
    integralLog: `${MEMBER_DOMAIN}/member/api/asset/v1/integral/records`,
    addressList: `${MEMBER_DOMAIN}/member/api/v1/address/list`,
    addressCreate: `${MEMBER_DOMAIN}/member/api/v1/address/create`,
    addressUpdate: `${MEMBER_DOMAIN}/member/api/v1/address/update`,
    addressDelete: (addressId) => `${MEMBER_DOMAIN}/member/api/v1/addresses/${addressId}`,
    addressParse: `${MEMBER_DOMAIN}/member/api/v1/address/parse`,
    recharge: `${MEMBER_DOMAIN}/member/api/asset/v1/recharge-order/create`,
    rechargePrepay: `${MEMBER_DOMAIN}`,
};

export const SHOP_URL = {
    setting: `${SHOP_DMAIN}/mall/customer/main`,
    config: `${SHOP_DMAIN}/mall/customer/page`,
    prefectureList: `${SHOP_DMAIN}/mall/customer/page/prods`,
    group: `${SHOP_DMAIN}/mall/customer/groups`,
    shelf: `${SHOP_DMAIN}/mall/customer/shelf`,
    bag: `${SHOP_DMAIN}/mall/customer/cart`,
    bagChange: `${SHOP_DMAIN}/mall/customer/cart`,
    bagDelete: `${SHOP_DMAIN}/mall/customer/cart`,
    requestId: `${SHOP_DMAIN}/mall/customer/cart/request-id`,
    orderCreate: `${SHOP_DMAIN}/mall/customer/order/combined/create`,
    orderCancel: `${SHOP_DMAIN}/mall/customer/order/combined/cancel`,
    orderPrepay: `${SHOP_DMAIN}/mall/customer/order/combined/pay`,
    orderPay: `${SHOP_DMAIN}/mall/customer/order/combined/pay`,
    orderTrigger: `${SHOP_DMAIN}/mall/customer/order/combined/trigger`,
    orderInfo: `${SHOP_DMAIN}/mall/customer/order/info`,
    orderConfirm: `${SHOP_DMAIN}/mall/customer/order/confirm`,
    orderList: `${SHOP_DMAIN}/mall/customer/order/query`,
    goodsDetail: `${SHOP_DMAIN}/mall/customer/prod`,
    refundDetail: `${SHOP_DMAIN}/mall/customer/refund/info`,
    refundApply: `${SHOP_DMAIN}/mall/customer/refund/apply`,
    refundCancel: `${SHOP_DMAIN}/mall/customer/refund/cancel`,
    refundDeliver: `${SHOP_DMAIN}/mall/customer/refund/deliver`,
    refundList: `${SHOP_DMAIN}/mall/customer/refund/query`,
    templateId: `${SHOP_DMAIN}/mall/customer/wechat/templates`,
};

export const INVENTORY_URL = {
    express: `${INVENTORY_DOMAIN}/inventory/common/express/platform`,
    matchSku: `${INVENTORY_DOMAIN}/inventory/customer/sku/match`,
    matchWarehouse: `${INVENTORY_DOMAIN}/inventory/customer/warehouse/match`,
    stores: `${INVENTORY_DOMAIN}/inventory/customer/warehouse/stores`,
};

export const MARKET_URL = {
    avaliableCouponList: `${MARKET_DOMAIN}/couponWithDistributionStats`,
    getCouponInfo: couponId => `${MARKET_DOMAIN}/coupon/${couponId}`,
    getCoupon: couponId => `${MARKET_DOMAIN}/coupon/${couponId}/getting`,
    cardDiscount: cardId => `${MARKET_DOMAIN}/card_discount/${cardId}`,
    couponList: `${MARKET_DOMAIN}/myCoupons`,
    calc: `${MARKET_DOMAIN}/off_trial`,
    activity: `${MARKET_DOMAIN}/promotions`,
    avaliable: `${MARKET_DOMAIN}/myAvailableCoupons`,
    discount: `${MARKET_DOMAIN}/offers/item`,
    specialDiscount: `${MARKET_DOMAIN}/offers/owner`,
};
